package com.wm.builder;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName: ComputerConcreteBuilder
 * @Description: 电脑具体的组装
 * @Author: WM
 * @Date: 2023/2/2 13:28
 */
public class ComputerConcreteBuilder implements ComputerBuilder {

    private final static Logger logger = LoggerFactory.getLogger(ComputerConcreteBuilder.class);

    Computer computer;

    public ComputerConcreteBuilder() {
        computer = new Computer();
    }

    @Override
    public void buildCpu() {
        logger.info("buildCpu......");
        computer.setCpu("8core");
    }

    @Override
    public void buildMemory() {
        logger.info("buildMemory......");
        computer.setMemory("16G");
    }

    @Override
    public void buildDisk() {
        logger.info("buildDisk......");
        computer.setDisk("1TG");

    }

    @Override
    public Computer buildComputer() {
        return computer;
    }
}
